#'
#'
#'
#' @description Based on (2.15) in the chapter2 in the Heer (2019)
#' @param y 2 independent variables in a nonlinear equation.
#'
diff_heer <- function(y, alpha = 0.36, delta = 0.08, n = 0, beta0 = 0.96, sigma = 2){
  k <- y[1]
  x <- y[2]
  f <- matlab::zeros(2,1)
  c1 <- x^(alpha)+(1-delta)*x-(1+n)*k
  f[1] <- k^(alpha)+(1-delta)*k-beta0^(1/sigma)*(1+alpha*k^(alpha-1)-delta)^(1/sigma)*c1
  f[1] <- f[1]/(1+n)
  f[2] <- k
  return(f)
}


